package com.by.web;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.context.request.ServletWebRequest;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@Controller
@SuppressWarnings({"all"})
public class UserController {

	private Logger log = LoggerFactory.getLogger(UserController.class);

	private static final String ADMIN_PREFIX = "/user";

	@GetMapping("/user")
	//@RequiresPermissions("user:manager")
	public String accessAdminUserPageGet(HttpServletRequest request, HttpServletResponse response) {
		   ServletWebRequest webRequest = new ServletWebRequest(request, response);

		return ADMIN_PREFIX + "/user";
	}

	@RequestMapping("/user/{id}")
	@ResponseBody
	public String getUser(@PathVariable(name = "id") String id) {
		return "测试查询用户信息";
	}
}